# coding = utf-8

class Dog(object):
    def __init__(self, name):
        self.name = name
        self.__food = None

    @property
    def eat(self):
        print("%s 吃食物：%s" % (self.name, self.__food))

    @eat.setter
    def eat(self, food):
        print("set food is :", food)
        self.__food = food

    @eat.deleter
    def eat(self):
        del self.__food
        print("删完了", self.__food)


a = Dog("mamao")
a.eat
# 作为属性后，不能用方法传参的方式穿了，直接用 等号
a.eat = "tudou"
a.eat = "hahahaha"
a.eat
# 删除这个属性，需要加 deleter后，才能写这个方法
del a.eat
a.eat
